<template>
  <div class="p-2">
    <!--引用表格-->
    <BasicTable @register="registerTable">
      <template #bodyCell="{ column, record, index, text }"> </template>
    </BasicTable>
  </div>
</template>

<script lang="ts" name="ddyht-ddygCzrzReturn" setup>
  import { ref, reactive, onMounted } from 'vue';
  import { BasicTable, useTable } from '/@/components/Table';
  import { useListPage } from '/@/hooks/system/useListPage';
  import { columns } from './JxcCzrzReturn.data';
  import { list } from './JxcCzrzReturn.api';
  import { useUserStore } from '/@/store/modules/user';

  const queryParam = reactive<any>({});
  const userStore = useUserStore();
  const username = userStore.getUserInfo.username;
  
  onMounted(() => {
    const userInfo = userStore.getUserInfo;
    console.log('userInfo.username', userInfo.username);
  });
  
  //注册table数据
  const { prefixCls, tableContext } = useListPage({
    tableProps: {
      title: '退货批次详情',
      api: list,
      columns,
      canResize: false,
      useSearchForm: false,
      showActionColumn: false,
      pagination: {
        pageSize: 10,
        showSizeChanger: true,
        showQuickJumper: true,
        showTotal: (total, range) => `第 ${range[0]}-${range[1]} 条/总共 ${total} 条`,
      },
      beforeFetch: (params) => {
        params.username = username;
        return Object.assign(params, queryParam);
      },
    },
  });
  
  const [registerTable, { reload }] = tableContext;
</script>

<style lang="less" scoped>
  .jeecg-basic-table-form-container {
    padding: 0;
    .table-page-search-submitButtons {
      display: block;
      margin-bottom: 24px;
      white-space: nowrap;
    }
    .query-group-cust {
      min-width: 100px !important;
    }
    .query-group-split-cust {
      width: 30px;
      display: inline-block;
      text-align: center;
    }
    .ant-form-item:not(.ant-form-item-with-help) {
      margin-bottom: 16px;
      height: 32px;
    }
    :deep(.ant-picker),
    :deep(.ant-input-number) {
      width: 100%;
    }
  }
</style>
